.class public abstract Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;
.super Ljava/lang/Object;
.source "ButtonDetaultDeviceKeyCodes.java"


# static fields
.field private static codes:Ljava/util/Map;

.field private static gameActions:Ljava/util/Map;


# direct methods
.method static constructor <clinit>()V
    .locals 3

    .prologue
    .line 50
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    sput-object v0, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->codes:Ljava/util/Map;

    .line 52
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    sput-object v0, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->gameActions:Ljava/util/Map;

    .line 84
    sget-object v0, Lorg/microemu/device/impl/ButtonName;->SOFT1:Lorg/microemu/device/impl/ButtonName;

    const/4 v1, -0x6

    invoke-static {v0, v1}, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->code(Lorg/microemu/device/impl/ButtonName;I)V

    .line 85
    sget-object v0, Lorg/microemu/device/impl/ButtonName;->SOFT2:Lorg/microemu/device/impl/ButtonName;

    const/4 v1, -0x7

    invoke-static {v0, v1}, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->code(Lorg/microemu/device/impl/ButtonName;I)V

    .line 86
    sget-object v0, Lorg/microemu/device/impl/ButtonName;->SELECT:Lorg/microemu/device/impl/ButtonName;

    const/4 v1, -0x5

    const/16 v2, 0x8

    invoke-static {v0, v1, v2}, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->code(Lorg/microemu/device/impl/ButtonName;II)V

    .line 87
    sget-object v0, Lorg/microemu/device/impl/ButtonName;->UP:Lorg/microemu/device/impl/ButtonName;

    const/4 v1, -0x1

    const/4 v2, 0x1

    invoke-static {v0, v1, v2}, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->code(Lorg/microemu/device/impl/ButtonName;II)V

    .line 88
    sget-object v0, Lorg/microemu/device/impl/ButtonName;->DOWN:Lorg/microemu/device/impl/ButtonName;

    const/4 v1, -0x2

    const/4 v2, 0x6

    invoke-static {v0, v1, v2}, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->code(Lorg/microemu/device/impl/ButtonName;II)V

    .line 89
    sget-object v0, Lorg/microemu/device/impl/ButtonName;->LEFT:Lorg/microemu/device/impl/ButtonName;

    const/4 v1, -0x3

    const/4 v2, 0x2

    invoke-static {v0, v1, v2}, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->code(Lorg/microemu/device/impl/ButtonName;II)V

    .line 90
    sget-object v0, Lorg/microemu/device/impl/ButtonName;->RIGHT:Lorg/microemu/device/impl/ButtonName;

    const/4 v1, -0x4

    const/4 v2, 0x5

    invoke-static {v0, v1, v2}, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->code(Lorg/microemu/device/impl/ButtonName;II)V

    .line 92
    sget-object v0, Lorg/microemu/device/impl/ButtonName;->BACK_SPACE:Lorg/microemu/device/impl/ButtonName;

    const/4 v1, -0x8

    invoke-static {v0, v1}, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->code(Lorg/microemu/device/impl/ButtonName;I)V

    .line 94
    sget-object v0, Lorg/microemu/device/impl/ButtonName;->KEY_NUM0:Lorg/microemu/device/impl/ButtonName;

    const/16 v1, 0x30

    invoke-static {v0, v1}, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->code(Lorg/microemu/device/impl/ButtonName;I)V

    .line 95
    sget-object v0, Lorg/microemu/device/impl/ButtonName;->KEY_NUM1:Lorg/microemu/device/impl/ButtonName;

    const/16 v1, 0x31

    const/16 v2, 0x9

    invoke-static {v0, v1, v2}, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->code(Lorg/microemu/device/impl/ButtonName;II)V

    .line 96
    sget-object v0, Lorg/microemu/device/impl/ButtonName;->KEY_NUM2:Lorg/microemu/device/impl/ButtonName;

    const/16 v1, 0x32

    invoke-static {v0, v1}, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->code(Lorg/microemu/device/impl/ButtonName;I)V

    .line 97
    sget-object v0, Lorg/microemu/device/impl/ButtonName;->KEY_NUM3:Lorg/microemu/device/impl/ButtonName;

    const/16 v1, 0x33

    const/16 v2, 0xa

    invoke-static {v0, v1, v2}, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->code(Lorg/microemu/device/impl/ButtonName;II)V

    .line 98
    sget-object v0, Lorg/microemu/device/impl/ButtonName;->KEY_NUM4:Lorg/microemu/device/impl/ButtonName;

    const/16 v1, 0x34

    invoke-static {v0, v1}, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->code(Lorg/microemu/device/impl/ButtonName;I)V

    .line 99
    sget-object v0, Lorg/microemu/device/impl/ButtonName;->KEY_NUM5:Lorg/microemu/device/impl/ButtonName;

    const/16 v1, 0x35

    invoke-static {v0, v1}, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->code(Lorg/microemu/device/impl/ButtonName;I)V

    .line 100
    sget-object v0, Lorg/microemu/device/impl/ButtonName;->KEY_NUM6:Lorg/microemu/device/impl/ButtonName;

    const/16 v1, 0x36

    invoke-static {v0, v1}, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->code(Lorg/microemu/device/impl/ButtonName;I)V

    .line 101
    sget-object v0, Lorg/microemu/device/impl/ButtonName;->KEY_NUM7:Lorg/microemu/device/impl/ButtonName;

    const/16 v1, 0x37

    const/16 v2, 0xb

    invoke-static {v0, v1, v2}, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->code(Lorg/microemu/device/impl/ButtonName;II)V

    .line 102
    sget-object v0, Lorg/microemu/device/impl/ButtonName;->KEY_NUM8:Lorg/microemu/device/impl/ButtonName;

    const/16 v1, 0x38

    invoke-static {v0, v1}, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->code(Lorg/microemu/device/impl/ButtonName;I)V

    .line 103
    sget-object v0, Lorg/microemu/device/impl/ButtonName;->KEY_NUM9:Lorg/microemu/device/impl/ButtonName;

    const/16 v1, 0x39

    const/16 v2, 0xc

    invoke-static {v0, v1, v2}, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->code(Lorg/microemu/device/impl/ButtonName;II)V

    .line 104
    sget-object v0, Lorg/microemu/device/impl/ButtonName;->KEY_STAR:Lorg/microemu/device/impl/ButtonName;

    const/16 v1, 0x2a

    invoke-static {v0, v1}, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->code(Lorg/microemu/device/impl/ButtonName;I)V

    .line 105
    sget-object v0, Lorg/microemu/device/impl/ButtonName;->KEY_POUND:Lorg/microemu/device/impl/ButtonName;

    const/16 v1, 0x23

    invoke-static {v0, v1}, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->code(Lorg/microemu/device/impl/ButtonName;I)V

    .line 106
    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 48
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method private static code(Lorg/microemu/device/impl/ButtonName;I)V
    .locals 2
    .parameter "name"
    .parameter "code"

    .prologue
    .line 109
    sget-object v0, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->codes:Ljava/util/Map;

    new-instance v1, Ljava/lang/Integer;

    invoke-direct {v1, p1}, Ljava/lang/Integer;-><init>(I)V

    invoke-interface {v0, p0, v1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 110
    return-void
.end method

.method private static code(Lorg/microemu/device/impl/ButtonName;II)V
    .locals 2
    .parameter "name"
    .parameter "code"
    .parameter "gameAction"

    .prologue
    .line 113
    invoke-static {p0, p1}, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->code(Lorg/microemu/device/impl/ButtonName;I)V

    .line 114
    sget-object v0, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->gameActions:Ljava/util/Map;

    new-instance v1, Ljava/lang/Integer;

    invoke-direct {v1, p2}, Ljava/lang/Integer;-><init>(I)V

    invoke-interface {v0, p0, v1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 115
    return-void
.end method

.method public static getButtonNameByGameAction(I)Lorg/microemu/device/impl/ButtonName;
    .locals 6
    .parameter "gameAction"

    .prologue
    .line 71
    new-instance v2, Ljava/lang/Integer;

    invoke-direct {v2, p0}, Ljava/lang/Integer;-><init>(I)V

    .line 72
    .local v2, value:Ljava/lang/Integer;
    sget-object v3, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->gameActions:Ljava/util/Map;

    invoke-interface {v3, v2}, Ljava/util/Map;->containsValue(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_1

    .line 73
    sget-object v3, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->gameActions:Ljava/util/Map;

    invoke-interface {v3}, Ljava/util/Map;->entrySet()Ljava/util/Set;

    move-result-object v3

    invoke-interface {v3}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .local v0, iterator:Ljava/util/Iterator;
    :cond_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_1

    .line 74
    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/util/Map$Entry;

    .line 75
    .local v1, v:Ljava/util/Map$Entry;
    invoke-interface {v1}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v3

    invoke-virtual {v3, v2}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_0

    .line 76
    invoke-interface {v1}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object p0

    .end local p0
    check-cast p0, Lorg/microemu/device/impl/ButtonName;

    return-object p0

    .line 80
    .end local v0           #iterator:Ljava/util/Iterator;
    .end local v1           #v:Ljava/util/Map$Entry;
    .restart local p0
    :cond_1
    new-instance v3, Ljava/lang/IllegalArgumentException;

    new-instance v4, Ljava/lang/StringBuffer;

    invoke-direct {v4}, Ljava/lang/StringBuffer;-><init>()V

    const-string v5, "Illegal action "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v4

    invoke-virtual {v4, p0}, Ljava/lang/StringBuffer;->append(I)Ljava/lang/StringBuffer;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v3
.end method

.method public static getGameAction(Lorg/microemu/device/impl/ButtonName;)I
    .locals 2
    .parameter "name"

    .prologue
    .line 63
    sget-object v1, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->gameActions:Ljava/util/Map;

    invoke-interface {v1, p0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Integer;

    .line 64
    .local v0, code:Ljava/lang/Integer;
    if-eqz v0, :cond_0

    .line 65
    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v1

    .line 67
    :goto_0
    return v1

    :cond_0
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public static getKeyCode(Lorg/microemu/device/impl/ButtonName;)I
    .locals 2
    .parameter "name"

    .prologue
    .line 55
    sget-object v1, Lorg/microemu/device/impl/ButtonDetaultDeviceKeyCodes;->codes:Ljava/util/Map;

    invoke-interface {v1, p0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Integer;

    .line 56
    .local v0, code:Ljava/lang/Integer;
    if-eqz v0, :cond_0

    .line 57
    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v1

    .line 59
    :goto_0
    return v1

    :cond_0
    const/4 v1, 0x0

    goto :goto_0
.end method
